/**
 * 按给出的方案计算即可
 */
#include <bits/stdc++.h>
using namespace std;

#include <bits/extc++.h>
using namespace __gnu_pbds;

using llt = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

int N;
vvi A;

void proc(){
    llt a = 0, b = 0, c = 0;
    auto m = N >> 1;
    for(int i=0;i<m;++i)for(int j=0,k=m-i;k>0;--k,++j){
        // cout << i << " " << j << "\n";
        a += A[i][j];
        A[i][j] = 0;
    }
    for(int i=m;i<N;++i)for(int j=N-1,k=1;k<=i-m+1;--j,++k){
        c += A[i][j];
        A[i][j] = 0;
    }
    for(const auto & a : A) b += accumulate(a.begin(), a.end(), 0LL);
    cout << a << " " << b << " " << c << "\n";
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("z.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(0);
    int nofkase = 1;
    // cin >> nofkase;
    while(nofkase--){
        cin >> N;
        A.assign(N, vi(N, 0));
        for(auto & a : A)for(auto & i : a)cin >> i;
        proc();
    }
    return 0;
}